﻿using System;

namespace Td.Additional.ComponentModel
{
    /// <summary>
    /// Id attribute.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
    public sealed class IdAttribute : Attribute
    {
        #region Properties

        /// <summary>
        /// Gets or sets the name of the id property.
        /// </summary>
        /// <value>The name of the id property.</value>
        public String IdPropertyName { get; private set; }

        #endregion

        #region Constructor

        /// <summary>
        /// Initializes a new instance of the <see cref="IdAttribute"/> class.
        /// </summary>
        /// <param name="idPropertyName">Name of the id property.</param>
        public IdAttribute(string idPropertyName)
        {
            IdPropertyName = idPropertyName;
        }

        #endregion
    }
}